/**
* @file curvefactory.cpp
* August 11, 2008
* 
* @brief Implements the interface for the Factory of the Curve objects.
* 
* @author Andre Pereira (brabo@tecgraf.puc-rio.br)
* 
* @see Curve
*/

// includes
//----------
#include "curvefactory.h"
#include "line.h"
#include "polyline.h"
#include "arc.h"
#include "spline.h"


// class implementation
//----------------------

//
/////////////////////////////////////////////////////////////////////
Curve* 
CurveFactory::create( Curve::ECurveType _type )
{
  Curve *obj = NULL;

  switch( _type )
  {
    case Curve::LINE:      obj = new Line;      break;
    case Curve::POLYLINE:  obj = new PolyLine;  break;
    case Curve::ARC:       obj = new Arc;       break;
    case Curve::SPLINE:    obj = new Spline;    break;
  }

  // Caution: do not forget to delete this object outside!
  return obj;
}


